#!/usr/bin/env sh

SCRIPT_PATH=$(realpath ".")
BIN_NAME="games"
TGZ_NAME="games.tar.gz"

echo "Starting go build"
cd ..
export GOOS=linux
export GOARCH=amd64
go build -o configs/"${BIN_NAME}" main.go

echo "make tar.gz"
cd configs/
tar zcvf "${TGZ_NAME}" "${BIN_NAME}" config
mv "${TGZ_NAME}" ${SCRIPT_PATH}/

echo "tar.gz is in ${SCRIPT_PATH}/${TGZ_NAME}"
echo "Finish"